package com.caregiver.watch.business.care.model.vo;

import com.caregiver.watch.business.care.enums.FenceRemindTypeEnum;
import com.caregiver.watch.business.care.model.dto.FenceLocation;
import com.caregiver.watch.business.care.model.dto.FenceRecipientInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalTime;
import java.util.List;
import java.util.Objects;

import static com.caregiver.watch.common.constant.NumberConstants.ONE;

/**
 * @description: 围栏设置详情
 * @program: caregiver-watch
 * @author: 疆戟
 * @create: 2025-10-06 09:48
 */
@Data
@Schema(description = "围栏设置详情")
public class FenceSettingDetailVo {

    @Schema(description = "围栏ID")
    private Long fenceId;

    @Schema(description = "围栏名称")
    private String fenceName;

    @Schema(description = "围栏生效开始时间(HH:mm)")
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    private LocalTime startTime;

    @Schema(description = "围栏生效结束时间(HH:mm)")
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    private LocalTime endTime;

    // 围栏提醒
    @Schema(description = "围栏提醒类型")
    private FenceRemindTypeEnum fenceRemindType;

    // 开启
    @Schema(description = "开启/关闭")
    private Boolean enable;

    @Schema(description = "围栏生效的照护人")
    private List<FenceRecipientInfo> effectiveRecipients;


    @Schema(description = "围栏位置信息")
    private List<FenceLocation> fenceLocations;



    public void setEnable(Integer enable) {
        this.enable = Objects.nonNull(enable) && enable == ONE;
    }
}
